package com.chen.wxchat.service.impl;

import com.chen.wxchat.dao.UserInfoDao;
import com.chen.wxchat.entity.UserInfo;
import com.chen.wxchat.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {

    @Autowired
    private UserInfoDao userInfoDao;

    @Override
    public boolean addUser(UserInfo userInfo) {
        return (userInfoDao.insertUser(userInfo)>0);
    }

    @Override
    public UserInfo getUserInfoById(String userId) {
        return userInfoDao.getUserInfoById(userId);
    }

    @Override
    public boolean registerUser(UserInfo userInfo) {
        return userInfoDao.updateUser(userInfo);
    }

    @Override
    public List<UserInfo> getRegisterUserList() {
        return userInfoDao.registerUserList();
    }

    @Override
    public UserInfo getUserStateInfoById(String userId) {
        return userInfoDao.getUserStateInfoById(userId);
    }
}
